package com.app.bean.vo;

import com.app.entity.Goods;
import lombok.Data;
import org.bson.types.ObjectId;

import java.io.Serializable;

/**
 * @autor xiaoyu.fang
 * @date 2019/10/11 16:53
 */
@Data
public class GoodsVO implements Serializable {
    /**
     * ID
     */
    private ObjectId id;
    /**
     * 标题
     */
    private String title;
    /**
     * 说明
     */
    private String explain;

    public GoodsVO() {
    }

    public GoodsVO(ObjectId id, String title, String explain) {
        this.id = id;
        this.title = title;
        this.explain = explain;
    }

    public static GoodsVO getGoodsVO(Goods goods) {
        return new GoodsVO(goods.getId(), goods.getTitle(), goods.getExplain());
    }
}
